<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改消毒记录')" />
	<th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-ncCowsDisinfection-edit" th:object="${ncCowsDisinfection}">
            <input id="dfId" name="dfId" th:field="*{dfId}"  type="hidden">
			<div class="form-group">
				<label class="col-sm-3 control-label">消毒时间：</label>
				<div class="col-sm-8">
					<input id="dfDate" data-format="yyyy-MM-dd HH:mm:ss" data-type="datetime" required name="dfDate"
						   th:value="*{#dates.format(dfDate, 'yyyy-MM-dd HH:mm:ss')}" class="form-control" type="text"
						   th:class="time-input">
					<!--<input id="dfDate" name="dfDate" class="form-control" type="text">-->
				</div>
			</div>
			<!--<div class="form-group">
				<label class="col-sm-3 control-label">药品批次：</label>
				<div class="col-sm-8">
					<input id="dfCode" name="dfCode" th:field="*{dfCode}" class="form-control" type="text">
				</div>
			</div>-->
			<div class="form-group">
				<label class="col-sm-3 control-label">消毒场所：</label>
				<div class="col-sm-8">
					<input id="dfPlace" name="dfPlace" th:field="*{dfPlace}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">消毒药名称：</label>
				<div class="col-sm-8">
					<div class="input-group">
						<input name="dfName" onclick="selectdisinfectionTree()" id="treeName" type="text" readonly="true" th:field="*{dfName}" placeholder="请选择" class="form-control" required>
						<span class="input-group-addon"><i class="fa fa-search"></i></span>
					</div>

					<!--<input id="dfName" name="dfName" th:field="*{dfName}" class="form-control" type="text">-->
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">使用量：</label>
				<div class="col-sm-8">
					<input id="dfUsed" name="dfUsed" th:field="*{dfUsed}" class="form-control" type="number">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">使用浓度：</label>
				<div class="col-sm-8">
					<input id="dfDensity" name="dfDensity" th:field="*{dfDensity}" class="form-control" type="number">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">消毒方法：</label>
				<div class="col-sm-8">
					<select id="dfType" class="form-control select2-multiple" name="dfType"
							th:with="type=${@dict.getType('xiaoduType')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
								th:field="*{dfType}"></option>
					</select>

					<!--<input id="dfType" name="dfType" th:field="*{dfType}" class="form-control" type="text">-->
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">消毒操作员：</label>
				<div class="col-sm-8">
					<select id="dfUser" class="form-control select2-multiple" name="dfUser">
						<option th:each="user:${dfUser}" th:value="${user.userId}" th:text="${user.userName}"
								th:selected="${user.flag}" th:disabled="${user.status == '1'}"></option>
					</select>
				</div>

				<!--<div class="col-sm-8">
					<input id="dfUser" name="dfUser" th:field="*{dfUser}" class="form-control" type="text">
				</div>-->
			</div>
			<!--<div class="form-group">
				<label class="col-sm-3 control-label">管理类型 1:鸡舍 2：牛舍：</label>
				<div class="col-sm-8">
					<input id="managerType" name="managerType" th:field="*{managerType}" class="form-control" type="text">
				</div>
			</div>-->
			<div class="form-group">
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<textarea id="remark" name="remark" th:field="*{remark}" class="form-control" rows="4" type="text"> </textarea>
				</div>
			</div>
			<!--<div class="form-group">
				<label class="col-sm-3 control-label">与药品关联的id：</label>
				<div class="col-sm-8">
					<input id="yaoId" name="yaoId" th:field="*{yaoId}" class="form-control" type="text">
				</div>
			</div>-->
		</form>
    </div>
    <div th:include="include::footer"></div>
	<th:block th:include="include :: select2-js" />
    <script type="text/javascript">
		var prefix = ctx + "system/ncCowsDisinfection";
		$("#form-ncCowsDisinfection-edit").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});

		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-ncCowsDisinfection-edit').serialize());
	        }
	    }


		//药品选择树
		function selectdisinfectionTree() {
			var treeId = $("#treeId").val();
			var disinfectionId = $.common.isEmpty(treeId) ? "1" : $("#treeId").val();
			var url = ctx + "system/ncYaoClass/selectYaoTree/" + disinfectionId;
			var options = {
				title: '药品选择',
				width: "380",
				url: url,
				callBack: doSubmit
			};
			$.modal.openOptions(options);
		}

		function doSubmit(index, layero) {
			var body = layer.getChildFrame('body', index);
			$("#treeId").val(body.find('#treeId').val());
			$("#treeName").val(body.find('#treeName').val());
			layer.close(index);
		}
	</script>
</body>
</html>
